/*
使用：<Pagination
      @handleCurrentChange="handleCurrentChange"
      @handleSizeChange="handleSizeChange"
      :item="pagenationItem"
    ></Pagination>
    paginationItem: {
        current_page: 1,
        page_sizes: [10, 20, 50, 100],
        page_size: 10,
        total: 100,
      },
      
*/ 

<template>
  <div>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="item.current_page"
      :page-sizes="item.page_sizes"
      :page-size="item.page_size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="item.total"
      :hide-on-single-page="item.hidePage"
      :small="item.small"
      :background="item.background"
    >
    </el-pagination>
  </div>
</template>
<script>
export default {
  props: {
    item: { type: Object },
  },
  methods: {
    handleSizeChange(newSize) {
      this.$emit("handleSizeChange", newSize);
    },
    handleCurrentChange(newPage) {
      this.$emit("handleCurrentChange", newPage);
    },
  },
};
</script>
